﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=640"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>转盘抽奖</title>
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <script type="text/javascript" src="jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="jQueryRotate.js"></script>
    <script type="text/javascript" src="script.js"></script>

    <style type="text/css">
        body {
            background: #8c8c8c;
            margin: 0;
            padding: 0;
        }

        .rotate-con-pan {
            background: url(disk.jpg) no-repeat 0 0;
            background-size: 100% 100%;
            position: relative;
            width: 480px;
            height: 480px;
            box-sizing: border-box;
            -moz-box-sizing: border-box;
            -webkit-box-sizing: border-box;
            top: 130px;
            margin: 0 auto
        }

        .rotate-con-zhen {
            width: 92px;
            height: 290px;
            background: url(start.png) no-repeat 0 0 transparent;
            background-size: 100% 100%;
            cursor: pointer;
            position: absolute;
            left: 190px;
            top: 100px;
        }

        @media screen and (max-width: 800px) {
            .men {
                background: url(bj.png) no-repeat ;
                background-size: 100% 90%;
                box-sizing: border-box;
                -moz-box-sizing: border-box;
                -webkit-box-sizing: border-box;
                height:840px;
                margin: 0;
                padding: 0;
            }
            .ren{ width:300px; height:700px; position:absolute; top:576px;}
            .button{ position:absolute; left:378px; top:866px;}
        }
        .bg {
            background-color: #ffffff;

            position: absolute;
            height:100%;
            width: 100%;
        }
        .bg IMG{
            margin: 0 auto;
            margin-top: 50%;
            margin-left: 20%;
        }
    </style>

</head>

<body>
<div id="hide_div" class="bg"  ><img src="load.gif"  /></div>
    <div id="main_div" class="men">
        <div class="rotate-con-pan">
            <div class="rotate-con-zhen"></div>
        </div>
    </div>
<div id="ren_div" class="ren"><img src="02.png" width="363" height="527" /></div>
<div id="button_div" class="button"><a id="a_link" href="#" ><img src="002.png" width="196" height="138" /></a></div>

<script type="text/javascript">
    $("#main_div").css("display","none");
    $("#ren_div").css("display","none");
    $("#button_div").css("display","none");
        window.onload = function () {
            $("#hide_div").css("display","none");
            $("#main_div").css("display","block");
            $("#ren_div").css("display","block");
            $("#button_div").css("display","block");
        var flag=0;
        var openid='123456';
        $(".rotate-con-zhen").click(function () {
            var a = runzp();
            if(flag==1){
                alert('您已参与过抽奖了！');
                return;
            }
            $(".rotate-con-zhen").rotate({
                duration: 3000,               //转动时间
                angle: 0,                    //起始角度
                animateTo: 1440 + a.angle,     //结束的角度
                easing: $.easing.easeOutSine,//动画效果，需加载jquery.easing.min.js
                callback: function () {
                    alert(a.message + ',' + a.prize);//简单的弹出获奖信息
                    var str_mes= a.message;
                    if(str_mes.indexOf("恭喜")!=-1){
                        $("#a_link").css("display","block");
                        $.ajax({
                                    type: 'GET',
                                    url:'http://m.tianfuhao.com.cn/weixin/tianfuhao_activities.php?act=insert&openid='+openid+'&statu='+ a.id,
                                    async : false,
                                    dataType : 'JSONP',
                                    success:function(data){alert(123);}
                                }
                        );
                    }
                    flag=1;
                }

            });
        });

    }

</script>

</body>
</html>